package com.wuxiaofan.member.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.member.entity.GrowthChangeHistory;
import com.wuxiaofan.member.entity.custom.GrowthChangeHistoryCustom;
import com.wuxiaofan.member.mapper.GrowthChangeHistoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.member.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class GrowthChangeHistoryService {
    @Autowired
    private GrowthChangeHistoryMapper umsGrowthChangeHistoryMapper;
    @Resource
    private Idgenerator idgenerator;
    public GrowthChangeHistory findById(String id){
        return umsGrowthChangeHistoryMapper.selectById(id);
    }

    public GrowthChangeHistoryCustom findCountByMap(Map paraMap){
        return umsGrowthChangeHistoryMapper.findCountByMap(paraMap);
    }

    public GrowthChangeHistoryCustom findGroupByMap(Map paraMap){
        return umsGrowthChangeHistoryMapper.findGroupByMap(paraMap);
    }

    public List<GrowthChangeHistoryCustom> findByMap(Map paraMap){
        return umsGrowthChangeHistoryMapper.findByMap(paraMap);
    }

    public Page<GrowthChangeHistoryCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(umsGrowthChangeHistoryMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        umsGrowthChangeHistoryMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        umsGrowthChangeHistoryMapper.deleteById(id);
    }

    public GrowthChangeHistory save(GrowthChangeHistory umsGrowthChangeHistory){
        umsGrowthChangeHistory.setId(idgenerator.getId());
        umsGrowthChangeHistoryMapper.insert(umsGrowthChangeHistory);
        return umsGrowthChangeHistory;
    }

}
